<template>
  <keep-alive>
    <component v-bind:is="currentComponent" v-bind="curProps" :ref="curComponentName"></component>
  </keep-alive>
</template>


<script>

import ParentAssetIssuance from './ParentAssetIssuance';
import AssetIssuance from './AssetIssuance';
export default {
  
  name:'AssetIssuanceFactory',
  props: {
    menuCode: String,
  },
  data () {
    return {
        currentComponent:ParentAssetIssuance,
        curProps:{menuCode:this.menuCode},
        curComponentName:'AssetsAudit'
    }
  },
  methods:{
    setCurrentComponent:function(type,data){
      if(type=="goBack")
      {
        //  this.curProps = data;
         this.currentComponent = ParentAssetIssuance;
         this.curComponentName = 'ParentAssetIssuance';
      }
      else if(type=="AssetIssuance")
      {
         this.curProps = data;
         this.currentComponent = AssetIssuance;
         this.curComponentName = 'AssetIssuance';
      }
    },
    enterDown(){
      if(this.$refs[this.curComponentName]&&this.$refs[this.curComponentName].enterDown){
        this.$refs[this.curComponentName].enterDown()
      }
    }
  },
  mounted: function mounted() {
    //this.$router.push({ path: '/ShellAssets' });//跳转到该路由
  }
}


</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
